#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<assert.h>

#ifndef LIST_ERRORS
    enum LIST_ERRORS{LIST_DAMAGED = 1, LIST_NULLPTR, LIST_LENGTH};
#endif // LIST_ERRORS
struct node
{
    char value[20];
    node* next;
    node* prev;
};
struct list_t
{
    node* firstNode;
    node* lastNode;
    int   length;
};

node* newNode();

int list_ctor   (list_t* List);
int list_dtor   (list_t* List);

//insert after
int list_insertA(list_t* List, node* afterN , char* value);
//insert before
int list_insertB(list_t* List, node* beforeN, char* value);
int list_delete (list_t* List, node* toDelete);
int list_error  (list_t* List, int err);
int list_ok     (list_t* List);
void list_dump   (list_t* List);
